package me.wsj.fengyun.ui.activity

import android.annotation.SuppressLint
import android.content.Intent
import android.graphics.Paint
import android.net.Uri
import android.quickapp.windrain.R
import android.quickapp.windrain.databinding.ActivityAboutBinding
import me.wsj.fengyun.ui.base.BaseActivity
import me.wsj.fengyun.utils.H5Utils
import me.wsj.lib.extension.toast
import per.wsj.commonlib.utils.CommonUtil

class AboutActivity : BaseActivity<ActivityAboutBinding>() {
    override fun bindView(): ActivityAboutBinding {
        return ActivityAboutBinding.inflate(layoutInflater)
    }

    override fun prepareData(intent: Intent?) {

    }

    @SuppressLint("SetTextI18n")
    override fun initView() {
        setTitle(getString(R.string.about))
        mBinding.tvWebSit.text = H5Utils.H5_WWW
        mBinding.tvAppNo.text = "APP备案号：${H5Utils.H5_NO}"
        mBinding.tvCopyCompany.text = H5Utils.H5_NAME +"版权所有"
        mBinding.tvVersionNum.text = CommonUtil.getVersionName(this)
    }

    override fun initEvent() {
        mBinding.tvAppNo.setOnClickListener {
            H5Utils.jump(this@AboutActivity, H5Utils.H5_BEIAN)
        }

        mBinding.tvWebSit.apply {
            setOnClickListener {
                val url = mBinding.tvWebSit.text.toString()
                startActivity(intent)
                H5Utils.jump(this@AboutActivity, url)
            }
            paint.apply {
                flags = Paint.UNDERLINE_TEXT_FLAG
                isAntiAlias = true
            }
        }
        mBinding.layPrivate.setOnClickListener {
            H5Utils.jump(this@AboutActivity, H5Utils.H5_PRIVATE)
        }

        mBinding.layProtect.setOnClickListener {
            H5Utils.jump(this@AboutActivity, H5Utils.H5_PROTECT)
        }
    }

    override fun initData() {

    }
}